package com.lantosec.hmrp.modules.warning.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.lantosec.hmrp.core.mvc.BaseEntity;
import com.lantosec.hmrp.modules.warning.vo.WarningNotifierDeptVO;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * <p>
 * 预警部门通知人 实体类
 * </p>
 *
 * @author AutoCode
 * @since 2020-05-20
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class WarningNotifierDept extends BaseEntity<WarningNotifierDeptVO> {

    private static final long serialVersionUID = 1L;
    public WarningNotifierDept(WarningNotifierDeptVO vo){
        this.ruleId = vo.getRuleId();
        this.dataDeptId = vo.getDataDeptId();
        this.thresholdValue = vo.getThresholdValue();
        this.notifierDeptId = vo.getNotifierDeptId();
        this.notifierPositionId = vo.getNotifierPositionId();
        this.smsTemplateId = vo.getSmsTemplateId();
        this.messageTemplate = vo.getMessageTemplate();
        this.flag = vo.getFlag();
        this.thresholdRemark = vo.getThresholdRemark();
    }

    @Override
    public WarningNotifierDeptVO convertToVO(){
        return new WarningNotifierDeptVO(this);
    }


    /**
     * 预警规则ID
     */
    @TableId(value = "rule_id", type = IdType.ASSIGN_UUID)
    private String ruleId;

    /**
     * 数据部门ID
     */
    private String dataDeptId;

    /**
     * 阀值列表,分隔
     */
    private String thresholdValue;

    /**
     * 预警通知人部门ID
     */
    private String notifierDeptId;

    /**
     * 预警通知人岗位ID
     */
    private String notifierPositionId;

    /**
     * 短信通知模板ID
     */
    private Integer smsTemplateId;

    /**
     * 信息模板内容
     */
    private String messageTemplate;

    /**
     * 阀值说明
     */
    private String thresholdRemark;


    @TableField(exist = false)
    private Integer flag;







    public enum ColName {
        rule_id, data_dept_id, threshold_value, notifier_dept_id, notifier_position_id, sms_template_id, message_template, 
    }
}
